package game.gui;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import interfaces.IClient;
import interfaces.IServer;

public class ClientGui extends UnicastRemoteObject implements IClient{
	
	IServer server ;
	
	public ClientGui(IServer server ) throws RemoteException{
		this.server = server;
		System.out.println(this.server.highScore());
		//super();
		//new GameGui();
	}
	
	
	@Override
	public void update() throws RemoteException {
		// TODO Auto-generated method stub
		
	}

	
	
	public static void main(String args[]){
/*		try {
			ClientGui c = new ClientGui();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
	
		java.rmi.registry.Registry registry = null;
		try {
			registry = java.rmi.registry.LocateRegistry.getRegistry("localhost", 55772);
			System.out.println("Found registry running on "+"localhost" +55772);
			ClientGui c = new ClientGui((IServer) registry.lookup("GameServer")); 
			
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		
		System.out.println("done.");
		
		
		
		
		
	}
	
	
}
